package thread;

public class ThreadDemo1 {
    public static void main(String[] args) {
        Thread m1 = new MyThread1();
        Thread m2 = new MyThread2();
        Thread m3 = new MyThread3();
        Thread m4 = new MyThread1();
        Thread m5 = new MyThread2();
        Thread m6 = new MyThread3();
        Thread m7 = new MyThread1();
        m1.start();
        m2.start();
        m3.start();
        m4.start();
        m5.start();
        m6.start();
        m7.start();

    }
}
class MyThread1 extends Thread {
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println(i);
        }
    }
}

class MyThread2 extends Thread{
    public void run() {
        for (int i = 0; i < 999; i++) {
            System.out.println(i);
        }
    }
}

class MyThread3 extends Thread{
    public void run() {
        for (int i = 0; i < 998; i++) {
            System.out.println(i);
        }
    }
}

class MyThread4 extends Thread{
    public void run() {
        for (int i = 0; i < 997; i++) {
            System.out.println(i);
        }
    }
}

class MyThread5 extends Thread{
    public void run() {
        for (int i = 0; i < 996; i++) {
            System.out.println(i);
        }
    }
}

class MyThread6 extends Thread{
    public void run() {
        for (int i = 0; i < 995; i++) {
            System.out.println(i);
        }
    }
}

class MyThread7 extends Thread{
    public void run() {
        for (int i = 0; i < 994; i++) {
            System.out.println(i);
        }
    }
}